﻿using FE.EntityCore.Entity;
using FE.EntityCore.Service;

namespace FE.Application
{
    public class TaskService
    {
        private string _targetPath = System.Configuration.ConfigurationManager.AppSettings["server"]?.ToString();

        public void Run()
        {
            // 1 get data
            // 2 根据获取的数据循环处理转换
            var attService = new AttachmentService();

            var list = attService.GetAttachmentList();

            if (list?.Count > 0)
            {
                //todo 如果数据特别多,是否考虑分1000条执行一次?
                //todo asp.net 一直运行的方法 https://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html
                //PDFService
            }
        }

        private bool ConvertAttachmentList(Sys_Attachment attachment)
        {
            PDFService.Convert();

            return false;
        }
    }
}